#ifndef __Ship__
#define __Ship__

#include "board_object.h"
#include "game_object_factory.h"

class Coord
{
public:
    Coord(int x, int y) { this->x = x; this->y = y; }
    Coord() { }
    int x, y; // 0-9
};

class Ship// : public BoardObject
{
public:
    enum Direction {
        TOP_DOWN,
        LEFT_RIGHT
    };
    enum Owner {
        PLAYER,
        ENEMY
    };
    Ship() {}
    Ship(unsigned int size, Direction direction, Owner owner);
    virtual ~Ship() {}
    virtual void load(std::unique_ptr<LoaderParams> const &pParams)
    {
        //BoardObject::load(std::move(pParams));
    }
    
    virtual void draw();

    virtual void update();
    virtual void clean() { /*BoardObject::clean();*/ }
    virtual std::string type() { return "Ship"; }
    void changeDirection();
    Vector2D increment() const;
    static Vector2D increment(Direction);
    unsigned int size() const { return m_size; }
    Direction direction() const { return m_direction; }
    void decLife();
    bool alive() const;
    bool placed() const;
    void placed(bool b);
    Owner owner() const { return m_owner; }
    void position(int cx, int cy);
private:
    unsigned int m_size;
    Direction m_direction;
    int m_life;
    bool m_placed;
    std::string textureID;
    Owner m_owner;
    Coord *m_position;
};

//class ShipCreator : public BaseCreator
//{
//    GameObject* createGameObject() const
//    {
//        return new Ship();
//    }
//};

#endif /* defined(__Ship__) */
